package com.yaoandw.web;

public class SearcherHelper {
	private static int width = 5;//选中页左右数量
	public static int getStartDisplayPage(int pageNo,int pageSize,int totalCnt){
		if(pageNo > width)
			return pageNo-width;
		else
			return 1;
	}
	public static int getEndDisplayPage(int pageNo,int pageSize,int totalCnt){
		int allPageCnt = totalCnt/pageSize+1;//总页数
		return allPageCnt<(pageNo+width)?allPageCnt:(pageNo+width);
	}
}
